package com.kuson.springcloud.service.rpc;

import com.kuson.springcloud.domain.CommonResult;
import com.kuson.springcloud.service.rpc.impl.AccountServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

/**
 * 减少用户余额的远程方法
 */
@FeignClient(value = "seata-account-service",fallback = AccountServiceImpl.class)
public interface AccountService {
    @PostMapping(value = "/account/decrease")
    CommonResult decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money);
}
